<%@page import="org.hibernate.validator.constraints.SafeHtml.Tag"%>
<%@ page import="cn.fl.framework.base.context.CurrentThreadContext" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN" >
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>项目产品详情</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
  <div>
  <input id="prdmarks" value="" style="display:none"/>
<div id="pageInTab" class="pageInTab">
   	 	<form id="basePrdForm1">
    	<div tabid="tabA" title="产品基本信息" lselected="true">
       			<div class="fieldset1 tabel_col clearFix">
       			  <div class="caption">
                                <span class="title">主车配置</span>
                    </div>
               		 <div style="display: none">
               		 	<input name="mfrId" id="mfrId" type="text"  value=""  class="ui-textbox"  disabled="disabled">
               		 	<input name="mfrNm" id="mfrNm" type="text"  value=""  class="ui-textbox"  disabled="disabled">
               		 	<input name="brCd" id="brCd" type="text"  value=""  class="ui-textbox"  disabled="disabled">
               		 	<input name="prdbscInfoId" id="prdbscInfoId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
               		 	<input name="carId" id="carId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
               		 	<input name="tkId" id="tkId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
               		 	<input name="prdId" id="prdId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
               		 	<input name="prdDtlId" id="prdDtlId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
                	 	<input name="removeFlag" id="removeFlag"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">
                	 	<input name="styleId" id="styleId"  type="hidden"  value=""   class="ui-textbox"  disabled="disabled">

               		 </div>
               		 		<div class="fieldBox col_33" >
	                        	<div class="label">产品名称</div>
				                <div class="field">
				                	<input name="prdNm"  id="prdNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
				                </div>
				           </div>
				           	<div class="fieldBox col_33" >
	                        	<div class="label">产品类型</div>
				                <div class="field">
				                	<input name="prdTypCdNm" id="prdTypCdNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
				                	<input name="prdTypCd" id="prdTypCd" type="hidden"  value=""  class="ui-textbox"  >
				                	<input name="prdCd" id="prdCd" type="hidden"  value=""  class="ui-textbox"  >
				                </div>
				           </div>

				           
				            	<div class="fieldBox col_33" >
	                        	<div class="label">车辆型号</div>
				                <div class="field">
				                	<input name="prdMdl" id="prdMdl" type="text"  value=""  class="ui-textbox" readonly="readonly">
				                </div>
				           	</div>
					<div class="fieldBox col_66" >
						<div class="label">车型名称</div>
						<div class="field">
							<input name="carStyleName" id="carStyleName" type="text"  value="${prdBscInfoVO.carStyleName }"  class="ui-textbox"  readonly="readonly">
						</div>
					</div>
				           	<div class="fieldBox col_33" id="isTk">
	                        	<div class="label">车型</div>
				                <div class="field">
				                	<input name="prdMdlSun" id="prdMdlSun" type="text"  value=""  class="ui-textbox" readonly="readonly">
				                </div>
				           	</div>
				           	
                  		<div class="fieldBox col_33" >
	                        	<div class="label">产品品牌</div>
				                <div class="field">
				                	<input name="brCdNm" id="brCdNm" type="text"  value=""  class="ui-textbox"  readonly="readonly">
				                </div>
					   </div>
						<div class="fieldBox col_33" >
							<div class="label">车系</div>
							<div class="field">
								<input name="modelNm" id="modelNm" type="text"  value="${prdBscInfoVO.modelNm }"  class="ui-textbox"  readonly="readonly">
							</div>
						</div>
						<div class="fieldBox col_33" >
							<div class="label">生产集团</div>
							<div class="field">
								<input name="productionCompany" id="productionCompany" type="text"  value=""  class="ui-textbox"  readonly="readonly">
							</div>
						</div>
				   <div id="tkOption"  style="display: none">
                         <div class="fieldBox col_33">
                                <div class="label">品牌类别</div>
                                <div class="field"> 
                                 <select id="brTypCd" name="brTypCd" readonly="readonly">
			                    	<c:forEach items="${brTypCdList}" var="brType">
			                    		<option value="${brType.key }">${brType.value }</option>
			                    	</c:forEach>
                  				  </select>
                                </div>
                            </div>

                </div>
                 <div class="fieldBox col_33"  id="licenseCdDiv"  style="display: none">
                     <div class="label">牌照类别</div>
                     <div class="field"> 
                      <select id="licenseCd" name="licenseCd" readonly="readonly">
		            	<c:forEach items="${licenseCdList}" var="license">
		            		<option value="${license.key }">${license.value }</option>
		            	</c:forEach>
       				  </select>
       				    <span class="requiredSymbol"  id="licenseCdTxt" style="display: none">*</span>
                  </div>
                </div>

				            <jsp:include page="../prjprdbscinfo/projectPrdBscInfoAddDynamicPage.jsp"></jsp:include>
				            	<div class="fieldBox col_33">
				                    <div class="label">是否新产品</div>
				                    <div class="field">
				                    	 <select id="isNew" name="isNew" onchange="setUsedPdShow()">
							                    	<c:forEach items="${yesNoCdList}" var="yesFlag">
							                    		<option value="${yesFlag.key }">${yesFlag.value }</option>
							                    	</c:forEach>
				                  		</select>
				                    </div>
				                </div>
				                   <!-- <div  id="usedPdDiv" class="fieldBox col_33" style="display:none">
				                    <div class="label">车辆已使用期限</div>
				                    <div class="field">
				                    	<select  id="secUsedPd" name="secUsedPd" >
				                    		<option value="0" selected="selected">0个月</option>
				                    	</select>
				                    </div>
				                </div> -->
				                <!-- 二手设备附加项 -->
		                <div class="fieldBox col_100">
		                <span style="color: red; display: none" id="SecondPrdText" >二手设备附加项</span>
		                </div>
		                <div id="SecondPrd"  style="display: none">
		                 <jsp:include page="../prjprdbscinfo/projectPrdBscInfoAddSecDynamicPage.jsp"></jsp:include>
		                 </div>
				          <div class="caption" >
                                <span class="title">上装配置</span>
                   		  </div>
			                <jsp:include page="../prjprdbscinfo/projectPrdDetailDynamicPage.jsp"></jsp:include>
				             <div class="caption">
                                <span class="title">项目相关信息</span>
                   		  </div>
                   		
                        <div class="fieldBox col_33">
                    <div class="label">参考价（元）</div>
                    <div class="field">
                    <c:if test="${fromCddFlag==1 }">
                        <input id="guidePc" name="guidePc" type="text"  class="ui-textbox"  value="${prdBscInfoVO.guidePc }"   onchange="guidePcChange()" validate="{number: true,required:true}"/>
                    </c:if>
                    <c:if test="${fromCddFlag!=1 }">
                        <input id="guidePc" name="guidePc" type="text"  class="ui-textbox"  value=""   onchange="guidePcChange()" validate="{number: true,required:true}"/>
                    </c:if>
                     <span class="requiredSymbol">*</span>
                    </div>
                </div>
                    <div class="fieldBox col_33">
                    <div class="label">数量</div>
                    <div class="field">
                        <input id="prdQty" name="prdQty" type="text"  class="ui-textbox"  value="" onchange="guidePcChange()" validate="{number: true,required:true}"/>
                     <span class="requiredSymbol">*</span>
                    </div>
                </div>
                  <div class="fieldBox col_33">
                    <div class="label">设备款合计（元）</div>
                    <div class="field">
                        <input id="prdAmt" name="prdAmt" type="text"  class="ui-textbox"  value="" readonly="readonly"/>
                    </div>
                </div>
               <div class="fieldBox col_100"  id="guideMsgDiv" style="display: none">
					<div class="label">注意事项：</div>
							<div class="field">
							<span style="color: red"> 包牌项目请在参考价填入包牌价格</span>
					 </div>
			  </div>
                   <div class="fieldBox col_33">
                    <div class="label">每台设备留购价（元）</div>
                    <div class="field">
                        <input id="rsrvPc" name="rsrvPc" type="text"  onblur="checkAmt();"   class="ui-textbox"  value="" validate="{number: true,required:true}"/>
                     <span class="requiredSymbol">*</span>
                    </div>
                </div>
                <div class="fieldBox col_33" id="irrPctText">
                    <div class="label">实际收益率</div>
                    <div class="field">
                        <input id="irrPct" name="irrPct" type="text"  class="ui-textbox"  value="" validate="{number: true}"/>%
                    </div>
                </div>
                    <c:if test="${prjTypCd=='CSYWCP'}">
                        <div class="fieldBox col_33">
                            <div class="label">厂商</div>
                            <div class="field">
                                <input name="mfr"  id="mfr"  type="text"  value="" placeholder="请选择" ltype="combobox"  validate="{required:true}">
                                <span class="requiredSymbol">*</span>
                                <div class="combo_itemList_wrap"></div>
                            </div>
                        </div>
                    </c:if>
                    <div class="fieldBox col_50">
                    <div class="label">供应商</div>
                    <div class="field">
                        <input name="splId"  id="splId"  type="text"  value="" placeholder="请选择"   onchange="getSplAccNos();"  ltype="combobox"  validate="{required:true}">
                         <span class="requiredSymbol">*</span>
                         <span id="addBtnSpl" class="sq-button sq-button-round" style="margin-left:22px" onclick="addSpl()">新增</span>
                         <div class="combo_itemList_wrap"></div>
                    </div>
                </div>
                <!-- 供应商ID -->
                 <div class="fieldBox col_50" >
                    <div class="label">供应商账号</div>
                    <div class="field">
                    	 <!--   <select id="splAccNoId" name="splAccNoId" validate="{required:true}">
                  		  </select> -->
                  		   <input name="splAccNoId"  id="splAccNoId"  type="text"  value="" placeholder="请选择"  onclick="getSplBankNo();"  ltype="combobox"  validate="{required:true}">
                         <span class="requiredSymbol">*</span>
                         <span id="addBtnSplAccNo" class="sq-button sq-button-round" style="margin-left:22px" onclick="addSplAccNo()">新增</span>
                         <div class="combo_itemList_wrap"></div>
                    </div>
                </div>
                 	<div class="fieldBox col_33" id="isHaveBckNo" style="display: none">
	                    <div class="label">是否有供应商返利账号</div>
	                    <div class="field">
	                    	 <select id="isBckNo" name="isBckNo" onchange="setSplBackBankShow()">
	                    	             <option value="">--请选择--</option>
				                    	<c:forEach items="${yesNoCdList}" var="yesFlag">
				                    		<option value="${yesFlag.key }" 
				                    		<c:if test="${hasSplBackNo==yesFlag.key}">
				                    		selected="selected"
				                    		</c:if>
				                    		>${yesFlag.value }</option>
				                    	</c:forEach>
	                  		</select>
	                    </div>
	                </div>
                   <!-- 供应商返利ID -->
                 <div class="fieldBox col_50"  id="splBckBankAccDiv"  style="display: none">
                    <div class="label">供应商返利账号</div>
                    <div class="field">
                  		   <input name="splBackBankNoId"  id="splBackBankNoId"  type="text"  value="" placeholder="请选择"  onclick="getSplBackBankNo();"  ltype="combobox"  >
                         <span class="requiredSymbol" id="splBackBankValidate" style="display: none">*</span>
                         <span id="addBtnSplBankAccNo" class="sq-button sq-button-round" style="margin-left:22px" onclick="addSplAccNo()">新增</span>
                         <div class="combo_itemList_wrap"></div>
                    </div>
                </div>
                
                 <div class="fieldBox col_33" id="isHaveSalBckNo" >
	                    <div class="label">是否有销售返利账号</div>
	                    <div class="field">
	                    	 <select id="isSalBckNo" name="isSalBckNo" onchange="setSalBackBankShow()">
	                    	             <option value="">--请选择--</option>
				                    	<c:forEach items="${yesNoCdList}" var="yesFlag">
				                    		<option value="${yesFlag.key }" 
				                    		<c:if test="${hasSalBackNo==yesFlag.key}">
				                    		selected="selected"
				                    		</c:if>
				                    		>${yesFlag.value }</option>
				                    	</c:forEach>
	                  		</select>
	                    </div>
	                </div>
	                     <!-- 供应商销售返利ID -->
                 <div class="fieldBox col_50"  id="salBckBankAccDiv"  style="display: none">
                    <div class="label">销售返利账号</div>
                    <div class="field">
                  		   <input name="salBackBankNoId"  id="salBackBankNoId"  type="text"  value="" placeholder="请选择"  onclick="getSalBackBankNo();"  ltype="combobox"  >
                         <span class="requiredSymbol" id="salBackBankValidate" style="display: none">*</span>
                         <span id="addBtnSplBankAccNo" class="sq-button sq-button-round" style="margin-left:22px" onclick="addSplAccNo()">新增</span>
                         <div class="combo_itemList_wrap"></div>
                    </div>
                </div>
	          <div class="fieldBox col_100"  id="msgDiv" style="display: none">
					<div class="label">注意事项：</div>
							<div class="field">
							<span style="color: red">销售返利投放后存在无法撤回风险，请在选择收款方账号信息时注意账号选择是否正确！若因账号选择或维护错误导致付错款，业务经理自行承担返利损失！</span>
					 </div>
			  </div>       
                      <!-- 供应商厂商信息 -->
                 <div class="fieldBox col_50"  id="splMfrDiv"  style="display: none">
                    <div class="label">供应商厂商信息</div>
                    <div class="field">
                  		 <input name="splMfrId"  id="splMfrId"  type="text"  value="" placeholder="请选择"  onclick="getSplMfrInfo();"  ltype="combobox"  >
                         <span class="requiredSymbol" id="splMfrInfoValidate" style="display: none">*</span>
                    </div>
                </div>
                
                </div>
	</div>
   </form>
	 
	 <div id="btnsBox" class="btnsBox" >
			<span id="saveBtn" class="sq-button sq-button-round" onclick="savePrjBscInfo()"><!-- <i class="sqBtnIco_10"></i> -->保存</span>
           <span id="cancelBtn" class="sq-button sq-button-round" onclick="cancelBtn()"><!-- <i class="sqBtnIco_14"></i> -->取消</span>
	 </div>
	 </form>
</div>
</div>
</div>


<script type="text/javascript">
var prjId="${prjId}";
var prdDetailId="${prdDetailId}";
var detailFlag = '${detailFlag}';
var splBanNo = '${splBanNo}';
var salBanNo = '${salBanNo}';
var id="${id}";
var beforePrdQty = '';
var beforeGuidePc = ''; 
var beforeRsrvPc = ''; 
var searchSplNm = '';
var bizCd = "${bizCd}";
var buOrgCd = '${buOrgCd}';
var prjTypCd = '${prjTypCd}';//项目类型
var insCode = '${insCode}';//机构代码
var hasSplBackNo = ${hasSplBackNo};
var hasSalBackNo = ${hasSalBackNo};
var hasBackNoFlag =  ${hasBackNoFlag};
var _rcCstBscInfoId = '';
var plcyTcode = '${plcyTcode}';
var prdTypCd = '${prdTypCd}';
var prdCd = '${prdCd}';//二级分类
var hasAccNoFlag = ${hasAccNoFlag};
var isSplMfr = '${isSplMfr}'
/*  var wait_dialog_refresh_field = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" }); */
$(function () {
    initMfrComboBox();
	 var basePrdForm1 = liger.get("basePrdForm1");
	var form = $("#basePrdForm1").ligerForm({
		validate: true
    });
    liger.get("rearAxleSpec").setDisabled(true);
    liger.get("mWhlSpec").setDisabled(true);
    liger.get("doorInfo").setDisabled(true);
    liger.get("tankVol").setDisabled(true);
    liger.get("secUsedPd").setDisabled(true);
    liger.get("actCntrSz").setDisabled(true);
    liger.get("thickness").setDisabled(true);
    liger.get("cylSepc").setDisabled(true);
    liger.get("matQalCd").setDisabled(true);
    liger.get("isNew").setDisabled(true);
    $("#othInfo").setDisabled_ligerTextarea(true);
    // $("#isNew").attr("disabled","true");
    $("#basePrdForm1").check_ligerFormEditor();
			initData();
			if(bizCd == "008001" || bizCd == "008004"){
				if(liger.get("carLen")&&liger.get("carLen")!="undefined"){
					liger.get("carLen").setDisabled(true);
				}
				if(liger.get("powerTypCd")&&liger.get("powerTypCd")!="undefined"){
					liger.get("powerTypCd").setDisabled(true);
				}
			}
			
			//设置影响产品价格的字段为不可修改
			/* if(liger.get("prdMdl")&&liger.get("prdMdl")!="undefined"){
				liger.get("prdMdl").setDisabled(true);
			} */
			if(liger.get("emiStdCd")&&liger.get("emiStdCd")!="undefined"){
				liger.get("emiStdCd").setDisabled(true);
			}
			if(liger.get("prdClsCd")&&liger.get("prdClsCd")!="undefined"){
				liger.get("prdClsCd").setDisabled(true);
			}
			if(liger.get("drvTyp")&&liger.get("drvTyp")!="undefined"){
				liger.get("drvTyp").setDisabled(true);
			}
			if(liger.get("engMdl")&&liger.get("engMdl")!="undefined"){
				liger.get("engMdl").setDisabled(true);
			}
			
			if(liger.get("prdLvlCd")&&liger.get("prdLvlCd")!="undefined"){
				liger.get("prdLvlCd").setDisabled(true);
			}
			if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_CAR){
				//汽车金融事业部隐藏保险购买方式、实际收益率
				   $("#irrPctText").hide();
				   $("#buyWayCdText").hide();
			}else{
				$("#irrPctText").show();
				$("#buyWayCdText").show();
			}

			
			if(liger.get("prdMdl")&&liger.get("prdMdl")!="undefined"){
				liger.get("prdMdl").setDisabled(true);
			}
			if(liger.get("prdNm")&&liger.get("prdNm")!="undefined"){
				liger.get("prdNm").setDisabled(true);
			}
			if(liger.get("prdTypCdNm")&&liger.get("prdTypCdNm")!="undefined"){
				liger.get("prdTypCdNm").setDisabled(true);
			}
			if(liger.get("brCdNm")&&liger.get("brCdNm")!="undefined"){
				liger.get("brCdNm").setDisabled(true);
			}
			if(liger.get("buyWayCd")&&liger.get("buyWayCd")!="undefined"){
				liger.get("buyWayCd").setDisabled(true);
			}
			if(liger.get("splMfrId")&&liger.get("splMfrId")!="undefined"){
				liger.get("splMfrId").setDisabled(true);
			}
			// if(liger.get("splAccNoId")&&liger.get("splAccNoId")!="undefined"){
			// 	liger.get("splAccNoId").setDisabled(true);
			// }
			// if(liger.get("splBackBankNoId")&&liger.get("splBackBankNoId")!="undefined"){
			// 	liger.get("splBackBankNoId").setDisabled(true);
			// }
			// if(liger.get("salBackBankNoId")&&liger.get("salBackBankNoId")!="undefined"){
			// 	liger.get("salBackBankNoId").setDisabled(true);
			// }
			// if(liger.get("isBckNo")&&liger.get("isBckNo")!="undefined"){
			// 	liger.get("isBckNo").setDisabled(true);
			// }
			// if(liger.get("isSalBckNo")&&liger.get("isSalBckNo")!="undefined"){
			// 	liger.get("isSalBckNo").setDisabled(true);
			// }
				if(liger.get("guidePc")&&liger.get("brCdNm")!="undefined"){
					liger.get("guidePc").setDisabled(true);
				}
				if(liger.get("mfrNm")&&liger.get("mfrNm")!="undefined"){
					liger.get("mfrNm").setDisabled(true);
				}
				
				if($("#prdRem")&&$("#prdRem")!="undefined"){
					$("#prdRem").setDisabled_ligerTextarea(true);
				}
				
				if($("#mOthInfo")&&$("#mOthInfo")!="undefined"){
					$("#mOthInfo").setDisabled_ligerTextarea(true);
				}
				
				if(liger.get("prdAmt")&&liger.get("prdAmt")!="undefined"){
					liger.get("prdAmt").setDisabled(true);
				}
				// if(liger.get("isNew")&&liger.get("isNew")!="undefined"){
				// 	liger.get("isNew").setDisabled(true);
				// }
				
				if(liger.get("fuelTypCd")&&liger.get("fuelTypCd")!="undefined"){
					liger.get("fuelTypCd").setDisabled(true);
				}
				if(liger.get("rsrvPc")&&liger.get("rsrvPc")!="undefined"){
			 		liger.get("rsrvPc").setDisabled(true);
				} 
				if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
					var qty = liger.get("prdQty");
					qty.setDisabled(true);
				}
				
				if(liger.get("irrPct")&&liger.get("irrPct")!="undefined"){
					liger.get("irrPct").setDisabled(true);
				}
				
				if(liger.get("deprRate")&&liger.get("deprRate")!="undefined"){
					liger.get("deprRate").setDisabled(true);
				}
				
				if(liger.get("deprAmt")&&liger.get("deprAmt")!="undefined"){
					liger.get("deprAmt").setDisabled(true);
				}
				if(liger.get("certDt")&&liger.get("certDt")!="undefined"){
					liger.get("certDt").setDisabled(true);
				}
				if(liger.get("invAmt")&&liger.get("invAmt")!="undefined"){
					liger.get("invAmt").setDisabled(true);
				}
				
				
				if(liger.get("secUsedPd")&&liger.get("secUsedPd")!="undefined"){
					liger.get("secUsedPd").setDisabled(true);
				}
				if(liger.get("deprRate")&&liger.get("deprRate")!="undefined"){
					liger.get("deprRate").setDisabled(true);
				}
				
				if(liger.get("deprAmt")&&liger.get("deprAmt")!="undefined"){
					liger.get("deprAmt").setDisabled(true);
				}
				if(liger.get("mfrNm")&&liger.get("mfrNm")!="undefined"){
					liger.get("mfrNm").setDisabled(true);
				}
				
			 	if($("#prdRem")&&$("#prdRem")!="undefined"){
				$("#prdRem").setDisabled_ligerTextarea(true);
					}
				 
			/* 	if(liger.get("prdLnkComp")){
					liger.get("prdLnkComp").setDisabled(true);
					} */
				// if(liger.get("splId")&&liger.get("splId")!="undefined"){
				// 	liger.get("splId").setDisabled(true);
				// 	}
			/* 	if(liger.get("isNew")&&liger.get("isNew")!="undefined"){
					liger.get("isNew").setDisabled(true);
				} */
					
				/* 	if(liger.get("prdUntCd")){
						liger.get("prdUntCd").setDisabled(true);
					} */
					
					if(liger.get("buyWayCd")&&liger.get("buyWayCd")!="undefined"){
						liger.get("buyWayCd").setDisabled(true);
					}
					
					
					if(liger.get("brTypCd")&&liger.get("brTypCd")!="undefined"){
						liger.get("brTypCd").setDisabled(true);
					}
					
					if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
						liger.get("prdQty").setDisabled(true);
					}
					//新能源
					if(liger.get("seatRowCd")&&liger.get("seatRowCd")!="undefined"){
						liger.get("seatRowCd").setDisabled(true);
					}
					if(liger.get("carVol")&&liger.get("carVol")!="undefined"){
						liger.get("carVol").setDisabled(true);
					}
					if(liger.get("extMil")&&liger.get("extMil")!="undefined"){
						liger.get("extMil").setDisabled(true);
					}
					if(liger.get("batDeg")&&liger.get("batDeg")!="undefined"){
						liger.get("batDeg").setDisabled(true);
					}	

	
	  if(detailFlag=="true"){
		  
		  if(liger.get("mWhlSpec")&&liger.get("mWhlSpec")!="undefined"){
				liger.get("mWhlSpec").setDisabled(true);
			} 
		  if(liger.get("thickness")&&liger.get("thickness")!="undefined"){
				liger.get("thickness").setDisabled(true);
			} 
		  
		  if(liger.get("grboxMdl")&&liger.get("grboxMdl")!="undefined"){
				liger.get("grboxMdl").setDisabled(true);
			} 
	 	if(liger.get("actCntrSz")&&liger.get("actCntrSz")!="undefined"){
			liger.get("actCntrSz").setDisabled(true);
		} 
		if($("#othInfo")&&$("#othInfo")!="undefined"){
			$("#othInfo").setDisabled_ligerTextarea(true);
		}
		if(liger.get("liftWayCd")&&liger.get("liftWayCd")!="undefined"){
			liger.get("liftWayCd").setDisabled(true);
		}
		if(liger.get("doorInfo")&&liger.get("doorInfo")!="undefined"){
			liger.get("doorInfo").setDisabled(true);
		}
		if(liger.get("cylSepc")&&liger.get("cylSepc")!="undefined"){
			liger.get("cylSepc").setDisabled(true);
		}
		if(liger.get("tankVol")&&liger.get("tankVol")!="undefined"){
			liger.get("tankVol").setDisabled(true);
		}
		if(liger.get("trlWhlSpec")&&liger.get("trlWhlSpec")!="undefined"){
			liger.get("trlWhlSpec").setDisabled(true);
		}
		if(liger.get("axleInfo")&&liger.get("axleInfo")!="undefined"){
			liger.get("axleInfo").setDisabled(true);
		}
		if(liger.get("matQalCd")&&liger.get("matQalCd")!="undefined"){
			liger.get("matQalCd").setDisabled(true);
		}
		
		if(liger.get("matQalCd")&&liger.get("matQalCd")!="undefined"){
			liger.get("matQalCd").setDisabled(true);
		}
		if(liger.get("isHvWhl")&&liger.get("isHvWhl")!="undefined"){
			liger.get("isHvWhl").setDisabled(true);
		}
		if(liger.get("trlWhlSpec")&&liger.get("trlWhlSpec")!="undefined"){
			liger.get("trlWhlSpec").setDisabled(true);
		}
		if(liger.get("liftWayCd")&&liger.get("liftWayCd")!="undefined"){
			liger.get("liftWayCd").setDisabled(true);
		}
		if(liger.get("isHvSub")&&liger.get("isHvSub")!="undefined"){
			liger.get("isHvSub").setDisabled(true);
		}
		
	}
 

		
		if(liger.get("prdClsCd")&&liger.get("prdClsCd")!="undefined"){
			liger.get("prdClsCd").setDisabled(true);
		}

		
		if(liger.get("cabSpec")&&liger.get("cabSpec")!="undefined"){
			liger.get("cabSpec").setDisabled(true);
		}
		if(liger.get("rearAxleSpec")&&liger.get("rearAxleSpec")!="undefined"){
			liger.get("rearAxleSpec").setDisabled(true);
		}
		if(liger.get("cntrSz")){
			liger.get("cntrSz").setDisabled(true);
		}
		if(liger.get("emiStd")){
			liger.get("emiStd").setDisabled(true);
		}
		/* if(liger.get("prdSeries")&&liger.get("prdSeries")!="undefined"){
			liger.get("prdSeries").setDisabled(true);
		} */
		if(liger.get("carMdl")&&liger.get("carMdl")!="undefined"){
			liger.get("carMdl").setDisabled(true);
		}
		if(liger.get("outVol")&&liger.get("outVol")!="undefined"){
			liger.get("outVol").setDisabled(true);
		}
		if(liger.get("grboxCfg")&&liger.get("grboxCfg")!="undefined"){
			liger.get("grboxCfg").setDisabled(true);
		}
		if(liger.get("carEngMdl")&&liger.get("carEngMdl")!="undefined"){
			liger.get("carEngMdl").setDisabled(true);
		}
		
		if(liger.get("carCl")&&liger.get("carCl")!="undefined"){
			liger.get("carCl").setDisabled(true);
		}
		if(liger.get("maxSpd")&&liger.get("maxSpd")!="undefined"){
			liger.get("maxSpd").setDisabled(true);
		}
		if($("#othCfg")&&$("#othCfg")!="undefined"){
			$("#othCfg").setDisabled_ligerTextarea(true);
		}
		if(liger.get("carLen")&&liger.get("carLen")!="undefined"){
			liger.get("carLen").setDisabled(true);
		}
		if(liger.get("drvTypCd")&&liger.get("drvTypCd")!="undefined"){
			liger.get("drvTypCd").setDisabled(true);
		}
		if(liger.get("carEngMdl")&&liger.get("carEngMdl")!="undefined"){
			liger.get("carEngMdl").setDisabled(true);
		}
		if(liger.get("hp")&&liger.get("hp")!="undefined"){
			liger.get("hp").setDisabled(true);
		}
		if(liger.get("prdYr")&&liger.get("prdYr")!="undefined"){
			liger.get("prdYr").setDisabled(true);
		}
		if(liger.get("prdCyCd")&&liger.get("prdCyCd")!="undefined"){
			liger.get("prdCyCd").setDisabled(true);
		}
		if(liger.get("grboxTypCd")&&liger.get("grboxTypCd")!="undefined"){
			liger.get("grboxTypCd").setDisabled(true);
		}
		if(liger.get("seatQtyCd")&&liger.get("seatQtyCd")!="undefined"){
			liger.get("seatQtyCd").setDisabled(true);
		}
		if(liger.get("carStrcCd")&&liger.get("carStrcCd")!="undefined"){
			liger.get("carStrcCd").setDisabled(true);
		}
		if(liger.get("prdWayCd")&&liger.get("prdWayCd")!="undefined"){
			liger.get("prdWayCd").setDisabled(true);
		}
		if(liger.get("powerTypCd")&&liger.get("powerTypCd")!="undefined"){
			liger.get("powerTypCd").setDisabled(true);
		}
		
		if(liger.get("carStrcCfg")&&liger.get("carStrcCfg")!="undefined"){
			liger.get("carStrcCfg").setDisabled(true);
		}

	if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK&&!(((prjTypCd==ProjectConstant.PRJ_TYP_CD_CPYW) && (isSplMfr == '1')) || ((prjTypCd==ProjectConstant.PRJ_TYP_CD_CTYW) && (isSplMfr == '1')))
	&&!insCode){
		$("#guideMsgDiv").show();
	}
	  
/* 	 if(prjTypCd==ProjectConstant.CODE_PRJ_TYP_CD_CPYW&&buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK){
		 $("#splBckBankAccDiv").show();
		 $("#splBackBankValidate").show();
		 //$("#splBackBankNoId").attr("validate","{required:true}");
	 } */
	// if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK){
		 $("#isHaveBckNo").show();
		 if(hasSplBackNo==1){
			 $("#splBckBankAccDiv").show();
		 }
		 if(hasSalBackNo==1){
			 $("#salBckBankAccDiv").show();
			 $("#msgDiv").show();
		 }
		 if(hasBackNoFlag==1){
			 //供应商返利账号、销售账号只读
				// if(liger.get("splBackBankNoId")&&liger.get("splBackBankNoId")!="undefined"){
				// 	liger.get("splBackBankNoId").setDisabled(true);
				// }
				// if(liger.get("salBackBankNoId")&&liger.get("salBackBankNoId")!="undefined"){
				// 	liger.get("salBackBankNoId").setDisabled(true);
				// }
				// if(liger.get("isBckNo")&&liger.get("isBckNo")!="undefined"){
				// 	liger.get("isBckNo").setDisabled(true);
				// }
				// if(liger.get("isSalBckNo")&&liger.get("isSalBckNo")!="undefined"){
				// 	liger.get("isSalBckNo").setDisabled(true);
				// }
		 }
		 
		 if(hasAccNoFlag==1){
			//放款账号只读
			//  if(liger.get("splAccNoId")&&liger.get("splAccNoId")!="undefined"){
			// 		liger.get("splAccNoId").setDisabled(true);
			// 	}
		 }
//	 }
	 
	 if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK&&(prjTypCd==ProjectConstant.CODE_PRJ_TYP_CD_CSYWCP||prjTypCd==ProjectConstant.CODE_PRJ_TYP_CD_CSYWCT)){
		 $("#splMfrDiv").show();
		 $("#splMfrInfoValidate").attr("validate","{required:true}");
	 }
	  if(prjTypCd==ProjectConstant.PRJ_TYP_CD_CPYW){
		  $("#licenseCdDiv").show();
		 $("#licenseCdTxt").show();
		 $("#licenseCd").attr("validate","{required:true}");
	  }else{
		  $("#licenseCdDiv").hide();
			 $("#licenseCdTxt").hide();
			 $("#licenseCd").attr("validate","");
	  }
   if(plcyTcode==ProjectConstant.PRD_PLCY_CD_C0002||plcyTcode==ProjectConstant.PRD_PLCY_CD_C0011){
		 $("#drvTypCd").attr("validate","{required:true}");
			var html = '<span class="requiredSymbol" id="drvTypCdReq">*</span>';
			$("#drvTypCd").parent().append(html);
	 }else{
		 $("#drvTypCd").attr("validate","");
     	$("#drvTypCdReq").hide();
	 }
	   $("#drvTypCd").change(function () {
           var drvTyp = $(this).val();
        if(plcyTcode==ProjectConstant.PRD_PLCY_CD_C0011&&drvTyp=="8×4"){
        	 $("#hp").attr("validate","{required:true}");
        	 var hpReq = $("#hpReq").text();
        	 if(!hpReq){
        	 var hpHtml = '<span class="requiredSymbol"  id="hpReq">*</span>';
 			$("#hp").parent().append(hpHtml);
        	 }else{
        		 $("#hpReq").show();
        	 }
        }else{
        	 $("#hp").attr("validate","");
        	$("#hpReq").hide();
        }
       }); 
	   
/* 		if($("#fuelTypeCd")&&prjTypCd!=ProjectConstant.CODE_PRJ_TYP_CD_ESC){
		
			 var prdForm1 = liger.get("basePrdForm1");
			 prdForm1.setFieldValidate("fuelTypeCd", {
	                required: false
	            });
		} */
})

function addSpl(){
	var prdmarks = $("#prdmarks").val();
        //弹出框校验供应商是否已存在
        $.ligerDialog.SQopen({
            width: 600,
            height:180,
            title : '请填写供应商名称和税务登记号',
            url:'<%=path%>/product/splInfo/toCheckSplPage.do?lxxz='+true+'&prdmarks='+prdmarks,
            buttons: [{
                	text: "确定", type: 'ok', cls: 'l-dialog-btn-ok',
	                onclick: function (item, Dialog) {
	                    if (Dialog.onOk) Dialog.onOk();
	                }
	            }, {
	                text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
	                onclick: function (item, Dialog) {
	                    if (Dialog.onCancel) Dialog.onCancel();
	                }
	            }
        	]

        });
	}
	
function addSplAccNo(){
	var _id = $("#splId_val").val();
	if(!_id)return;
	Add_navTab('PrdSpl_4'+_id,'供应商账号',"<%=path%>/product/splBank/toListPage.do?splId="+_id+"&lxxz="+true);
}	

function checkAmt(){
var checkRsrvPc;
	var _url ='<%=path%>/project/prjprdbscinfo/checkRsrvPc.do';
   	var params = {};
   	if(!checkRsrvPc){
	   	$.ajax({
	   		type: 'get',
	   		dataType:'json',
	   		data:params,
	   		url: _url,
	   		success:function(msg){
	   			 if(msg.success == 1){
	   				checkRsrvPc = msg.data;
	   				if(checkRsrvPc){
	   					checkRsrvPc = checkRsrvPc/100;
	   					var rsrvPc = $("#rsrvPc").val();
	   					if(rsrvPc<checkRsrvPc){
	   						 top.$.ligerDialog.SQalert({content: "留购价不能小于100",SQ_type: "error"});
	   					}
	   				}
	   			 }else{
	   				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
	   			 }
	   		}
	   	});
   	}

}
//根据选择的供应商信息获取供应商账号信息
<%-- function showSplAccNo(){
	 $("#splAccNoId").html(' ');
	var splId =liger.get("splId").selectedValue;
	var audStsCd=FlowConstant.FLOW_CHECK_STATE_PASS;
	var html = "<option value=''>--请选择--</option>";
		//查询账号信息
		   if(splId){
				var _url ='<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do';
			   	var params = {};
			   	params.splId=splId;
			   	params.audStsCd = audStsCd;
			   	$.ajax({
			   		type: 'get',
			   		dataType:'json',
			   		data:params,
			   		url: _url,
			   		success:function(msg){
			   			 if(msg.success == 1){
			   				 var splBankNOList = msg.data;
			   				 if(splBankNOList){
			   					 for(var i=0;i<splBankNOList.length;i++){
			   						 var bankNo = splBankNOList[i];
			   						html += "<option value='"+bankNo.id+"'>"+bankNo.accNo+"</option>";
			   					 }
			   				 }
			   				 
			   			 }
			   			 $(html).appendTo('#splAccNoId');
			   	         liger.get("splAccNoId").setSelect();
			   	        liger.get("splAccNoId").setValue(splBanNo);
	   					$("#splAccNoIdDiv").show();
			   		}
			   	});
	}
	
}
 --%>

 var audStsCdList = new Array();
	//audStsCdList.push(CommonConstant.C_AUD_NO_HAPPEN_CODE);
		if(buOrgCd!=ProjectConstant.CODE_BU_ORG_CD_CAR){
			   audStsCdList.push(CommonConstant.C_AUD_ADNWAY_CODE);
			}
	audStsCdList.push(CommonConstant.C_AUD_PASS_CODE);
	var audStsCdListArr = JSON.stringify(audStsCdList);
	//设置折旧后金额
	function setSecAmt(){
	 	var invAmt = $("#invAmt").val();
	 	var secRate =  $("#deprRate").val();
	 	var discountAmt = 0;
	 	if(invAmt&&secRate){
	 		discountAmt = parseFloat(invAmt)*parseFloat(secRate);
	 	}
	 	$("#deprAmt").val(discountAmt);
	 	
	 }

	function initData(){
		//默认数量为1
		var prdQty = $("#prdQty").val();
		if(prdQty==""){
			$("#prdQty").val("1");
		}
		if(insCode==ProjectConstant.PRJ_INS_CODE_ICBC){
			$("#rsrvPc").removeAttr("onblur");
			$("#rsrvPc").val(0);
			$("#prdQty").val("1");
			//数量为1不可修改
			/*if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
				liger.get("prdQty").setDisabled(true);
			}*/
			//添加提示
		/* 	var  mOthInfo = $("#mOthInfo");
			if($("#mOthInfo")){
				var html = '<span style="color: red">请按照以下规则维护备注信息：<br/>合同号：**********，上装分期：*期、月供：*元；或此项目已包含上装部分报价</span>';
			$("#mOthInfo").before(html);
			} */
		}
		var rsrvPc = $("#rsrvPc").val();
		if(rsrvPc==""){
			$("#rsrvPc").val("100");
		}
		
		
		   if(!liger.get("certDt")){
			   //没有二手车信息，默认是新车，是否新车不可修改
			// liger.get("isNew").setDisabled(true);
		   }
		 if(!id){
	 	 var isNew = $("#isNew").val();
			if(prjTypCd==ProjectConstant.CODE_PRJ_TYP_CD_ESC){
				  liger.get("isNew").setValue("0");
				//$("#isNew").val("0");
				//设置不可选
				//  var slt=liger.get("isNew");
	            //  slt.setDisabled(true);
			}else{
				if(isNew=='1'){
					//默认不可选
					 var slt=liger.get("secUsedPd");
			             slt.setDisabled(true);
				}
			}
		 } 
		
		 
	
		var styleId = '${styleId}';
		var prdBscInfo = '${prdBscInfoVO}';
		var tkFlag ='${tkFlag}';
		var modifyFlag ='${modifyFlag}';
		if(modifyFlag){
			getDataByDetailId(id);
		}else{
		setDataByPrdTypeAndDetailId(styleId);
		}
		if(tkFlag){
			$("#lnkComp").show();
			$("#tkOption").show();
		}
		setUsePdOption();//设置已用月份option
		var guidePc = $("#guidePc").val();
    	var prdQty = $("#prdQty").val();
		if(guidePc&&prdQty){
		    //设置小计值
			guidePcChange();
		}
    }
    //设置小计值
    function guidePcChange(){
    	var guidePc = $("#guidePc").ligerGetTextBoxManager().getValue();
    	var prdQty = $("#prdQty").ligerGetTextBoxManager().getValue();
    	 var total =0;
    	if(guidePc&&prdQty){
	     total = NumberUtils.mul(guidePc,prdQty);
    	}
	    $("#total").text(total);
	    $("#prdAmt").val(total);
    }
    //设置可选
   function setUsedPdShow(){
    	
    	var prdmarks = $("#prdmarks").val();
    	var isNew = $("#isNew").val();
    	if(isNew=='0'){
    		 $("#SecondPrd").show();
    		 if(prdmarks!="car"){
    			 $("#SecondPrdText").show(); 
    		 }
    		 setUsePdOption();
    		 // var usedPd=liger.get("secUsedPd");
    		 // if(usedPd){
    			//  if(detailFlag!="true"){
    		 // 	 usedPd.setEnabled(true);
    			//  }else{
    			// 	 usedPd.setDisabled(true);
    			//  }
    		 // }
    		 if(prdmarks!="car"){
    			 setSecAmt();
    		 }
    	}
    	if(isNew=='1'){
    		 $("#SecondPrd").hide();
    		 $("#SecondPrdText").hide();
    		  var usedPd=liger.get("secUsedPd");
    		  setUsePdOption();
    		  if(usedPd){
    			   liger.get("secUsedPd").setValue(0);
    		      usedPd.setDisabled(true);
    		  }
    	}
    }
    //设置可选
   function setUsedPd(){
	   var certDt = liger.get("certDt").getValue();
	   if(certDt){
	   var date = new Date(certDt);
	   var month=date.getMonth()+1;
	   var currMonth = (new Date()).getMonth()+1;
	   var year = date.getYear();
	   var currYear = (new Date()).getYear();
	   var diffMonth =(currYear-year)*12+ currMonth-month+1;
	   liger.get("secUsedPd").setValue(diffMonth);

	//   var secUsedPd = $("#secUsedPd").val(diffMonth+"");
	   //设置usedPd值，并设为不可选
	    var usedPd=liger.get("usedPd");
		  if(usedPd){
			  liger.get("usedPd").setValue(diffMonth);
		      usedPd.setDisabled(true);
		  }
		  //设置折旧率
			var _url ='<%=path%>/project/prjbscinfo/getDiscountRate.do';
		   	var params = {};
		   	params.month=diffMonth;
		   	$.ajax({
		   		type: 'get',
		   		dataType:'json',
		   		data:params,
		   		url: _url,
		   		success:function(msg){
		   			 if(msg.success == 1){
		   				 $("#deprRate").val(msg.data);
		   			 }else{
		   				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
		   			 }
		   		}
		   	});
		  
	   }
   }
   var fromCddFlag = '${fromCddFlag}';
   function getDataByDetailId(prjPrdId){
	//if(fromCddFlag==1)return;
       var _url ='<%=path%>/project/vehicle/getPrjPrdBscInfoAndExtById.do';
   	if(!prjPrdId)return;

       $.ajax({
   		type: 'get',
   		dataType:'json',
   		data:{id:prjPrdId},
   		url: _url,
   		success:function(msg){
            if(msg){
   				setPrjPrdBscInfo(msg);//设置数据
   			 }else{
   				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
   			 }
   		}
   	});
   }
    function setDataByPrdTypeAndDetailId(styleId){
		var _url ='<%=path%>/project/vehicle/carDetail.do';
    	$.ajax({
    		type: 'get',
    		dataType:'json',
    		data:{id:styleId},
    		url: _url,
    		async:false,
    		success:function(msg){
    			 if(msg){
    				 setData(msg);//设置数据
    			 }else{
    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
    			 }
    		}
    	});
    }
     var comboGrid_defaultValue1='${splId}';
     var comboGrid_defaultText1 = '${splNm}';
     var isInit_setSearchComboVal1 = false;
    var COMBO_SPL = $("#splId").ligerComboBox({
        width: 300,
        selectBoxWidth: 300,
        selectBoxHeight: 240,
        valueField: 'id',
        textField: 'splNm',
        isMultiSelect: true,
        isSingleCheck: true,
        grid: getSplGridOptions(true),
        parms: {condition:JSON.stringify([{"op":"like","field":"splNm","value": comboGrid_defaultText1,"type":"text"}])},
        condition: {
            labelWidth: 0,
            space: 5,
            fields: [{ name: 'splNm', width: 90, type:'text' , keyName: 'id'}]
        },
    /*     conditionSearchClick: function (a) {
            COMBO_MNG.grid.loadData($.ligerFilter.getFilterFunction(a.rules));
        }, */
        delayLoadGrid: false,
        onChangeValue: function (value) {
            if (COMBO_SPL) {
                if (value=="") comboGrid_defaultValue1 = ""; //如果点击清空'x'，就滞空初始值
                $("#splId").show_ligerComboItems(".combo_itemList_wrap");
            };
            var _selected = this.gridManager.getSelected()
            var rcId = _selected && _selected.rcCstBscInfoId;
            if(typeof(rcId) != "undefined" && rcId!=null){
            	_rcCstBscInfoId = rcId;
            }
            SetIframe_height();
        }
    });
  //供应商
  liger.get("splNm").setValue(searchSplNm);
 	var selectSplNm =  liger.get("splNm").getValue();
    function getSplGridOptions(checkbox){
    	//if(fromCddFlag==1)return;
    	var _prjId = '${prjId}';
        var options = {
            columns: [
                { display: '供应商名称', name: 'splNm',
                	render: function (rowdata, rowindex, value, column) { 
	            		 value ==null?"":value;
	            		var h = '';
	            		var audStsCd = rowdata.audStsCd;
	            		if(audStsCd){
	            		  if(audStsCd==FlowConstant.FLOW_CHECK_STATE_NON||audStsCd==FlowConstant.FLOW_CHECK_STATE_IN){
		                    	h+='<i class="ico_flasher"></i>';
		                    }
	            		}
	                        h+=value;
	                        return h;
	            	},
                	minWidth: 150 },
                { display: '企业性质', name: 'corpTypCdNm', minWidth: 100 },
                { display: '经营范围', name: 'bizScope', minWidth: 150 },
                { display: '注册资本', name: 'regCapAmt', minWidth: 50 },
                { display: '实收资本', name: 'paidCapAmt', minWidth: 50 },
                { display: '黑名单', name: 'isBlackList',width:1, hide:true},
            ],
            switchPageSizeApplyComboBox: false,
            url: '<%=path%>/project/prjprdbscinfo/splInitList.do?audStsCdList='+audStsCdListArr+'&prjId='+_prjId,
            //parms: {condition:[{"op":"like","field":"splNm","value": comboGrid_defaultValue1,"type":"text"}]},
            method: 'get',
            dataAction: 'local',
            root:'rows',
	        record:'total',
            pageSize: 10,
            usePagerOnLessPagesize: false,
            cssClass: "SMALL_grid",
            isSingleCheck: true,
            frozen: false,
            isSelected: function (rowdata) {
                if (comboGrid_defaultValue1 == "") return false;
                var defaultItems = comboGrid_defaultValue1.split(";");
                if(!isInit_setSearchComboVal1) { //只在初始化时执行一次，在onAfterShowData后改变
                    for (var i = 0; i < defaultItems.length; i++) {
                        if(rowdata[COMBO_SPL.options.valueField] == defaultItems[i]) {
                            return true;
                        }
                    };
                };
                return false;
            },
            onAfterShowData: function (currentData) {
                if(!isInit_setSearchComboVal1) { //只在初始化时执行一次，在onAfterShowData后改变
                	COMBO_SPL.setInputValue(comboGrid_defaultValue1, comboGrid_defaultText1, true);
                    isInit_setSearchComboVal1 = true;
                }
            },
            onSelectRow:function(rowdata){
				if(buOrgCd==ProjectConstant.CODE_BU_ORG_CD_ZK){
                    if(rowdata){
                        if(rowdata.isBlackList=='1'){
                            $.ligerDialog.error("该挂靠公司列为黑名单，请重新选择");
                            return false;
                        }
                    }
                }
                return true;
            }
        };
        return options;
    }
	function setUsePdOption(){
		var html = "";
		for(var i=1;i<31;i++){
			html+="<option value="+i+">"+i+"个月</option>";
		}
		$("#secUsedPd").append(html);
	}

    function setMfrComboBoxText(mfrNm){
          if(mfrNm){
              var mfrComboBox = liger.get("mfr");
              if(mfrComboBox){
                  mfrComboBox.setText(mfrNm);
              }
          }
    }
  function setPrjPrdBscInfo(basePrdInfo){
        var prjPrdExtVO = basePrdInfo.prjPrdExtVO;
        setMfrComboBoxText(basePrdInfo.mfrNm)
	  if(basePrdInfo){
	    	 var basePrdForm1 = liger.get("basePrdForm1");
	     	 basePrdForm1.setData({
	    		 prdNm: basePrdInfo.prdNm,
                 carStyleName: basePrdInfo.carStyleName,
                 modelNm: basePrdInfo.modelNm,
	    		 prdClsCdNm: basePrdInfo.prdClsCdNm,
	    		 prdTypCd: basePrdInfo.prdTypCd,
	    		 prdCd: basePrdInfo.prdCd,
	    		 brCdNm:basePrdInfo.brCd,
	    		 brCd: basePrdInfo.brCd,
	    		 prdMdl: basePrdInfo.prdMdl,
	    		 prdMdlSun: basePrdInfo.prdMdlSun,
	    		 mfrId: basePrdInfo.mfrId,
	    		 mfrNm: basePrdInfo.mfrNm,
	    		 prdRem: basePrdInfo.prdRem,
	    		 audStsCd: basePrdInfo.audStsCd,
	    		 prdTypCdNm: basePrdInfo.prdTypCdNm,
	    		 isNew :basePrdInfo.isNew ,
	    		 usedPd :basePrdInfo.usedPd ,
	    		 secUsedPd :basePrdInfo.usedPd ,
	    		 rsrvPc :basePrdInfo.rsrvPc , 
	    		 guidePc :basePrdInfo.guidePc,
	    		 prdQty :basePrdInfo.prdQty ,
	    		 prdAmt :basePrdInfo.prdAmt ,
	    		 prdUseCd :basePrdInfo.prdUseCd ,
	    		 prdRem :basePrdInfo.prdRem ,
	    		 irrPct :basePrdInfo.irrPct ,
	    		 prdbscInfoId:basePrdInfo.id,
	    		 usedPd:basePrdInfo.usedPd,
	    		 prdAmt:basePrdInfo.prdAmt,
	    		 certDt:basePrdInfo.certDt,
				 invAmt:basePrdInfo.invAmt,
				 splId:basePrdInfo.splId,
				 prdId:basePrdInfo.prdId,
				 guidePc:basePrdInfo.guidePc,
				 splAccNoId:basePrdInfo.splAccNoId,
				 //
				 certDt:basePrdInfo.certDt,
				 invAmt:basePrdInfo.invAmt,
				 deprRate:basePrdInfo.deprRate,
				 deprAmt:basePrdInfo.deprAmt,
				 prdDtlId:basePrdInfo.prdDtlId
	         }); 
	     	 if(StringUtils.isNotEmpty(basePrdInfo.ctrValue)){
	     		if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
					liger.get("prdQty").setDisabled(true);
				}
	     	 }
	     	 $("#mfrId").val(basePrdInfo.mfrId);
	     	 $("#brCd").val(basePrdInfo.brCd);
	     	 $("#carId").val(basePrdInfo.id);
	     	 $("#tkId").val(basePrdInfo.id);
	     	 $("#isNew").val(basePrdInfo.isNew);
	     	 $("#prdId").val(basePrdInfo.prdId);
	     	 $("#prdDtlId").val(basePrdInfo.prdDtlId);
	    	 $("#prdbscInfoId").val(basePrdInfo.id);
	    	 searchSplNm = basePrdInfo.splNm;
	     	var guidePc = $("#guidePc").ligerGetTextBoxManager().getValue();
	    	var prdQty = $("#prdQty").ligerGetTextBoxManager().getValue();
		    var total = NumberUtils.mul(guidePc,prdQty);
		    $("#total").text(total);
		   	    beforePrdQty = prdQty;
		   		beforeGuidePc = guidePc;
		   		beforeRsrvPc = $("#rsrvPc").val();
	     	  basePrdForm1 = liger.get("basePrdForm1");
	      		$("#isTk").hide();
	      		$("#prdmarks").val("car");
	      		// liger.get("isNew").setEnabled(true);


	      		basePrdForm1.setData({
	     	   	/* prdSeries: carInfo.prdSeries, */
	     	   	modelNm:prjPrdExtVO.modelName,
				productionCompany:prjPrdExtVO.productionCompany,
				carLen: prjPrdExtVO.carLen,
	     	 	prdYr: prjPrdExtVO.prdYr,
	     	 	prdCyCd: prjPrdExtVO.prdCyCd,
	     	 	outVol: prjPrdExtVO.outVol,
	     	 	prdMdlSun: prjPrdExtVO.prdMdl,
	     	 	grboxTypCd: prjPrdExtVO.grboxTypfd,
	     	 	grboxCfg: prjPrdExtVO.grboxCfg,
	     	 	seatQtyCd: prjPrdExtVO.seatQtyCd,
	     	 	engMdl: prjPrdExtVO.engMdl,
	     	 	drvTypCd: prjPrdExtVO.drvTypCd,
	     	 	carStrcCd: prjPrdExtVO.carStrcCd,
	     	 	carStrcCfg: prjPrdExtVO.carStrcCfg,
	     	 	powerTypCd: prjPrdExtVO.powerTypCd,
	     	 	carCl: prjPrdExtVO.carCl,
	     	 	maxSpd: prjPrdExtVO.maxSpd,
	     	 	prdWayCd: prjPrdExtVO.prdWayCd,
	     	 	carMdl: prjPrdExtVO.carMdl,
	     	 	othCfg: prjPrdExtVO.othCfg,
	     	 	carVol: prjPrdExtVO.carVol,
	     	 	extMil: prjPrdExtVO.extMil,
	     	 	batDeg: prjPrdExtVO.batDeg,
	     	 	emiStdCd:prjPrdExtVO.emiStdCd,
	     	 	carId:prjPrdExtVO.id,
	     	 	prdLvlCd:prjPrdExtVO.prdLvlCd
	            });  
	      		 $("#carId").val(prjPrdExtVO.id);
	      	 basePrdForm1 = liger.get("basePrdForm1");
	     		basePrdForm1.setData({
	     	   	prdId: prjPrdExtVO.prdId,
	     	   drvTyp: prjPrdExtVO.drvTyp,
	     	  engMdl: prjPrdExtVO.engMdl,
	     	 hp: prjPrdExtVO.hp,
	     	emiStd: prjPrdExtVO.emiStd,
	     	cabSpec: prjPrdExtVO.cabSpec,
	     	prdMdlSun: prjPrdExtVO.prdMdl,
	     	grboxMdl: prjPrdExtVO.grboxMdl,
	     	rearAxleSpec: prjPrdExtVO.rearAxleSpec,
	     	mWhlSpec: prjPrdExtVO.mwhlSpec,
	     	 prdClsCd: prjPrdExtVO.prdClsCd,
    		 prdCd: prjPrdExtVO.prdCd,
    		 //prdMdl: basePrdInfo.prdMdl,
	     	cntrSz: prjPrdExtVO.cntrSz,
	     	actCntrSz: prjPrdExtVO.actCntrSz,
	     	thickness: prjPrdExtVO.thickness,
	     	axleInfo: prjPrdExtVO.axleInfo,
	     	matQalCd: prjPrdExtVO.matQalCd,
	     	liftWayCd: prjPrdExtVO.liftWayCd,
	     	doorInfo: prjPrdExtVO.doorInfo,
	     	isHvWhl: prjPrdExtVO.isHvWhl,
	     	trlWhlSpec: prjPrdExtVO.trlWhlSpec,
	     	cylSepc: prjPrdExtVO.cylSepc,
	     	tankVol: prjPrdExtVO.tankVol,
	     	othInfo: prjPrdExtVO.othInfo,
	     	tkId:prjPrdExtVO.id,
	     	brTypCd:prjPrdExtVO.brTypCd,
	     	buyWayCd:prjPrdExtVO.buyWayCd,
	     	prdClsCd:prjPrdExtVO.prdClsCd,
	     	emiStd:prjPrdExtVO.emiStd,
	     	gasCylSpec:prjPrdExtVO.gasCylSpec,
	     	saddleSpec:prjPrdExtVO.saddleSpec,
	     	isHvAirCnd:prjPrdExtVO.isHvAirCnd,
	     	whlBase:prjPrdExtVO.whlBase,
	     	isHvSub:prjPrdExtVO.isHvSub,
	     	batDeg:prjPrdExtVO.batDeg,
	     	seatRowCd:prjPrdExtVO.seatRowCd,
	     	clsExfPc:prjPrdExtVO.clsExfPc,
	     	mOthInfo:prjPrdExtVO.mothInfo,
	     	fuelTypCd:prjPrdExtVO.fuelTypCd
	            });
	     	  setUsedPdShow();
	     	 setSecAmt();
	  }
  }
  
  
    function setData(basePrdInfo){

        var basePrdForm1 = liger.get("basePrdForm1");
    	if(StringUtils.isNotEmpty(basePrdInfo.ctrValue)){
     		if(liger.get("prdQty")&&liger.get("prdQty")!="undefined"){
				liger.get("prdQty").setDisabled(true);
			} 
     		basePrdForm1.setData({
     			prdQty: basePrdInfo.ctrValue
     		});
     	 }else{
     		basePrdForm1.setData({
     			prdQty: 1
     		});
     	 }
     	 basePrdForm1.setData({
			 modelNm:basePrdInfo.modelName,
			 carStyleName:basePrdInfo.carStyleName,
			 styleId:basePrdInfo.styleId,
			 productionCompany:basePrdInfo.productionCompany,
    		 prdNm: basePrdInfo.prdNm,
    		 prdClsCdNm: basePrdInfo.prdClsCdNm,
    		 prdClsCd: basePrdInfo.prdClsCd,
    		 prdCd: basePrdInfo.prdCd,
    		 prdTypCd: basePrdInfo.prdTypCd,
    		 brCdNm:basePrdInfo.brCdNm,
    		 brCd: basePrdInfo.brCd,
    		 prdMdl: basePrdInfo.prdMdl,
    		 prdMdlSun:basePrdInfo.prdMdl,
    		 secUsedPd :basePrdInfo.usedPd ,
    		 mfrId: basePrdInfo.mfrId,
    		 mfrNm: basePrdInfo.mfrNm,
    		 guidePc :basePrdInfo.guidePcDouble,
    		 prdRem: basePrdInfo.prdRem,
    		 audStsCd: basePrdInfo.audStsCd,
    		 prdTypCdNm: basePrdInfo.prdTypCdNm,
    		 prdId:basePrdInfo.id,
         });

        basePrdForm1 = liger.get("basePrdForm1");
     	  // car
      		$("#isTk").hide();
      		// liger.get("isNew").setEnabled(true);

        var guidePc = (basePrdInfo.guidePc/100).toFixed(2);


      		basePrdForm1.setData({
     	   	/* prdSeries: carInfo.prdSeries, */
     	 	 carLen: basePrdInfo.carLen,
     	 	prdYr: basePrdInfo.prdYr,
     	 	prdCyCd: basePrdInfo.prdCyCd,
     	 	outVol: basePrdInfo.outVol,
     	 	grboxTypCd: basePrdInfo.grboxTypCd,
     	 	grboxCfg: basePrdInfo.grboxCfg,
     	 	seatQtyCd: basePrdInfo.seatQtyCd,
     	 	engMdl: basePrdInfo.engMdl,
     	 	drvTypCd: basePrdInfo.drvTypCd,
     	 	carStrcCd: basePrdInfo.carStrcCd,
     	 	carStrcCfg: basePrdInfo.carStrcCfg,
     	 	powerTypCd: basePrdInfo.powerTypCd,
     	 	guidePc :guidePc,
      	 	maxSpd: basePrdInfo.maxSpd,
     	 	prdWayCd: basePrdInfo.prdWayCd,
     	 	carMdl: basePrdInfo.carMdl,
     	 	othCfg: basePrdInfo.othCfg,
     	 	carVol: basePrdInfo.carVol,
     	 	extMil: basePrdInfo.extMil,
     	 	batDeg: basePrdInfo.batDeg,
     	 	emiStdCd:basePrdInfo.emiStdCd,
     		prdId:basePrdInfo.prdId,
     	 	prdLvlCd:basePrdInfo.prdLvlCd
            });


        basePrdForm1 = liger.get("basePrdForm1");
        // TK
        basePrdForm1.setData({
            prdId: basePrdInfo.prdId,
            drvTyp: basePrdInfo.drvTyp,
            engMdl: basePrdInfo.engMdl,
            hp: basePrdInfo.hp,
            emiStd: basePrdInfo.emiStd,
            cabSpec: basePrdInfo.cabSpec,
            grboxMdl: basePrdInfo.grboxMdl,
            rearAxleSpec: basePrdInfo.rearAxleSpec,
            mWhlSpec: basePrdInfo.mWhlSpec,
            guidePc :guidePc,
            cntrSz: basePrdInfo.cntrSz,
            actCntrSz: basePrdInfo.actCntrSz,
            thickness: basePrdInfo.thickness,
            axleInfo: basePrdInfo.axleInfo,
            prdMdl: basePrdInfo.prdMdl,
            matQalCd: basePrdInfo.matQalCd,
            liftWayCd: basePrdInfo.liftWayCd,
            doorInfo: basePrdInfo.doorInfo,
            isHvWhl: basePrdInfo.isHvWhl,
            trlWhlSpec: basePrdInfo.trlWhlSpec,
            cylSepc: basePrdInfo.cylSepc,
            tankVol: basePrdInfo.tankVol,
            othInfo: basePrdInfo.othInfo,
            prdId:basePrdInfo.prdId,

            gasCylSpec:basePrdInfo.gasCylSpec,
            saddleSpec:basePrdInfo.saddleSpec,
            isHvAirCnd:basePrdInfo.isHvAirCnd,
            whlBase:basePrdInfo.whlBase,
            isHvSub:basePrdInfo.isHvSub,
            batDeg:basePrdInfo.batDeg,
            seatRowCd:basePrdInfo.seatRowCd,
            clsExfPc:basePrdInfo.clsExfPc,
            mOthInfo:basePrdInfo.mOthInfo,
            fuelTypCd:basePrdInfo.fuelTypCd
        });
        if(liger.get("drvTypCd")&&liger.get("drvTypCd")!="undefined"){
            liger.get("drvTypCd").setValue(basePrdInfo.drvTyp);
        }
        var drvTyp = basePrdInfo.drvTyp;
        if(plcyTcode==ProjectConstant.PRD_PLCY_CD_C0011&&drvTyp=="8×4"){
            $("#hp").attr("validate","{required:true}");
            var hpReq = $("#hpReq").text();
            if(!hpReq){
                var hpHtml = '<span class="requiredSymbol"  id="hpReq">*</span>';
                $("#hp").parent().append(hpHtml);
            }else{
                $("#hpReq").show();
            }
        }else{
            $("#hp").attr("validate","");
            $("#hpReq").hide();
        }

        $("#prdDtlId").val(prdDetailId);
        $("#mfrId").val(basePrdInfo.mfrId);
        $("#brCd").val(basePrdInfo.brCd);
        $("#prdId").val(basePrdInfo.id);
        var guidePc = $("#guidePc").val();
        var prdQty = $("#prdQty").val();
        if(guidePc&&prdQty){
            //设置小计值
            guidePcChange();
        }

        setUsedPdShow()
     	 }


  //取消
	function cancelBtn(){
		  var TAB=top.mainApp.parentTab;
          var currentTabid=TAB.getSelectedTabItemID();
		 top.tab.removeTabItem(currentTabid);
	}
  
  function savePrjBscInfo(){
	  var ligerForm = liger.get("basePrdForm1");
	  if (!ligerForm.valid()) {
			top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
			return false; //验证不通过，不执行以下代码
	  }

	  var guidePc = $("#guidePc").ligerGetTextBoxManager().getValue();
	var prdQty = $("#prdQty").ligerGetTextBoxManager().getValue();
	var prdbscInfoId = $("#prdbscInfoId").val();
	var rsrvPc = $("#rsrvPc").val();
  	if(guidePc&&prdQty&&prdbscInfoId&&rsrvPc){
  		if(guidePc!=beforeGuidePc||beforePrdQty!=prdQty||rsrvPc!=beforeRsrvPc){
  			var _ids = [];
  			_ids.push(prdbscInfoId);
  			var params = {};
			params.prjId=prjId;
			params.ids = JSON.stringify(_ids);
			// 查询支付表是否存在
				$.ajax({
				type: 'get',
				dataType:'json',
				data:params,
				url: '<%=path%>/project/prjprdbscinfo/checkPrjPrdDtlExist.do',
				success:function(msg){
					 if(msg.data==true){
						    $.ligerDialog.SQalert({
				                SQ_showButtons: true,
				                SQ_onBtnclick: function (item, Dialog) {
				                	$("#removeFlag").val(CommonConstant.C_YN_Y);
									save();
				                },
				                content: "已经存在支付表信息，确定删除已经拆分的支付表,修改数量和指导价信息吗？"
				            });
						}else{
							$("#removeFlag").val(CommonConstant.C_YN_N);
							save();
						}
					
					}
							
			});
  	  	}else{
  	  	$("#removeFlag").val(CommonConstant.C_YN_N);
  	  		save();
  	  	}
  	}else{
  		$("#removeFlag").val(CommonConstant.C_YN_N);
  		save();
	}
  	
  }
  
	//保存项目基础信息
	function save(){
        var ligerForm = liger.get("basePrdForm1");
         if (!ligerForm.valid()) {
            top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }
      
        var splNm = $("#splId").val();
        var data = ligerForm.getData();
        var prjId = '${prjId}';
        var prdCd = '${pCd}';
    	var isNew = $("#isNew").val();
    	var rcCstBscInfoId = _rcCstBscInfoId;
        if(isNew=="1"&&$("#prdbscInfoId").val()){
        	//设置二手车相应的字段为空
        	 data["invAmt"] = 0;
        	 data["certDt"] = null;
        	 data["usedPd"] = 0;
        	 data["deprRate"] = 0;
        	 data["deprAmt"] = 0;
        }
        data["prjId"] = prjId;
        data["prdCd"] = prdCd;
        data["splNm"] = splNm;
        data["styleId"] = "${styleId}";
        data["carId"] = $("#carId").val();
        data["tkId"] = $("#tkId").val();
        data["mfrId"]=$("#mfrId").val();
        data["prdId"]=$("#prdId").val();
        data["prdDtlId"]=$("#prdDtlId").val();
        data["prdQty"]=$("#prdQty").val();
        data["prdbscInfoId"] = $("#prdbscInfoId").val();
        data["removeFlag"] = $("#removeFlag").val();
        data["rcCstBscInfoId"] = rcCstBscInfoId;
        data["splMfrId"] = $("#splMfrId").ligerComboBox().getValue();
        data["splMfrNm"] = $("#splMfrId").val();
        data["prdTypCd"] = prdTypCd;
        // 如果选择了客车  验证是否有车身长度，如果没有则不允许保存
		if(prdTypCd){
		    if(prdTypCd == "52"){
		        var carLen = $("#carLen").val();
				if(!carLen){
                    UIUtils.alertError("缺少车身长度信息，不能保存!");
                    return false;
                }
		    }
        }
        var accNoArr = [];
        var accNo1 = {};
        accNo1.splAccNoId=$("#splAccNoId").ligerComboBox().getValue();
        accNo1.purpCd = 1;
        accNoArr.push(accNo1);
        var  backNo = $("#splBackBankNoId").val();
        if(backNo){
        var accNo2 = {};
        accNo2.splAccNoId=$("#splBackBankNoId").ligerComboBox().getValue();
        accNo2.purpCd = 2;
        accNoArr.push(accNo2);
        }
        //返利账号
        var  salBackAccNo = $("#salBackBankNoId").val();
        if(salBackAccNo){
        var accNo3 = {};
        accNo3.splAccNoId=$("#salBackBankNoId").ligerComboBox().getValue();
        accNo3.purpCd = 11;
        accNoArr.push(accNo3);
        }
        data["bankAccNoList"]=JSON.stringify(accNoArr);
       data["licenseCd"]=$("#licenseCd").val();
        var url = '<%=path%>/project/vehicle/addPrdAndPrdDetail.do';
        var wait_dialog;
        $.ajax({
    		type: 'post',
    		dataType:'json',
    		data:data,
    		url: url,
    		beforeSend: function(){
		          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
    		success:function(msg){
    			 if(msg.success == 1){
    				 wait_dialog.close();
    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
    					var TAB=top.mainApp.parentTab;
			            var currentTabid=TAB.getSelectedTabItemID();
			            var currFrameElement=top.$("#"+currentTabid).get(0);
						 var callback=currFrameElement.W2W.callback;
		          	  		callback();
		          	 	 top.tab.removeTabItem(currentTabid); 
    			 }else{
    				 wait_dialog.close();
    				 UIUtils.alertError(msg.info);
    			 }
    		}
    	});
	}
   function getSplBankNo(){
	    	var splId =liger.get("splId").selectedValue;
	    	if(splId==undefined){
	    		return;
	    	}
	    	var bankId='${accId}';
	    	var audStsCdList = new Array();
			//audStsCdList.push(CommonConstant.C_AUD_NO_HAPPEN_CODE);
			if(buOrgCd!=ProjectConstant.CODE_BU_ORG_CD_CAR){
			   audStsCdList.push(CommonConstant.C_AUD_ADNWAY_CODE);
			}
			audStsCdList.push(CommonConstant.C_AUD_PASS_CODE);
			var audStsCdListArr = JSON.stringify(audStsCdList);
	        $.ajax({
	            url: '<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do?splId='+splId+'&&audStsCdList='+audStsCdListArr,
	            dataType:'json',
	            success: function (res) {
	                var splAccNoId = liger.get('splAccNoId');
	                splAccNoId.gridManager.loadData(res);
	                splAccNoId.clear();
	                if(bankId){
	                  splAccNoId.setValue(bankId);
	                }
	            }
	        });
   }

   		
   var comboGrid_defaultValue2='${accId}';
   var comboGrid_defaultText2 = '${accNo}';
   var isInit_setSearchComboVal2 = false;
  var COMBO_BANK = $("#splAccNoId").ligerComboBox({
      width: 300,
      selectBoxWidth: 300,
      selectBoxHeight: 240,
      valueField: 'id',
      textField: 'accNo',
      isMultiSelect: true,
      isSingleCheck: true,
      grid: getBankNoGridOptions(true),
      delayLoadGrid: false
  });
  
  function getBankNoGridOptions(checkbox){
  	var splId =liger.get("splId").selectedValue;
      var options = {
          columns: [
              { display: 'id', name: 'id', minWidth: 150,hide:true },
              { display: '收款人', name: 'rcptUnt', 
          		render: function (rowdata, rowindex, value, column) { 
           		 value ==null?"":value;
           		var h = '';
           		if(rowdata.audStsCd){
           		  if(rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_NON||rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_IN){
	                    	h+='<i class="ico_flasher"></i>';
	                 }
           		}
                   h+=value;
                       return h;
           	},
            	  minWidth: 150 },
              { display: '对公/对私', name: 'bizTypCdNm', minWidth: 50 },
              { display: '收款账号', name: 'accNo', minWidth: 100 },
              { display: '开户银行', name: 'bkNm', minWidth: 150 },
              { display: '开户行号', name: 'bkNo', minWidth: 50 },
              
          ],
          switchPageSizeApplyComboBox: false,
          //url: '<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do?splId=splId&&audStsCd='+FlowConstant.FLOW_CHECK_STATE_PASS+'&&purpCd=1',
          method: 'get',
          data:null,
          dataAction: 'local',
          root:'rows',
	        record:'total',
          pageSize: 10,
          usePagerOnLessPagesize: false,
          cssClass: "SMALL_grid",
         // checkbox: checkbox,
          isSingleCheck: true,
          frozen: false,
          isSelected: function (rowdata) {
              if (comboGrid_defaultValue2 == "") return false;
              var defaultItems = comboGrid_defaultValue2.split(";");
              if(!isInit_setSearchComboVal2) { //只在初始化时执行一次，在onAfterShowData后改变
                  for (var i = 0; i < defaultItems.length; i++) {
                      if(rowdata[COMBO_BANK.options.valueField] == defaultItems[i]) {
                          return true;
                      }
                  };
              };
              return false;
          },
          onAfterShowData: function (currentData) {
              if(!isInit_setSearchComboVal2) { //只在初始化时执行一次，在onAfterShowData后改变
              	COMBO_BANK.setInputValue(comboGrid_defaultValue2, comboGrid_defaultText2, true);
                  isInit_setSearchComboVal2 = true;
              }
          }
      };
      return options;
  }	
		
  
  
  
  //供应商返利账号
   function getSplBackBankNo(){
	    	var splId =liger.get("splId").selectedValue;
	    	if(splId==undefined){
	    		return;
	    	}
	    	var backAccId='${backAccId}';
	    	var audStsCdList = new Array();
			if(buOrgCd!=ProjectConstant.CODE_BU_ORG_CD_CAR){
			   audStsCdList.push(CommonConstant.C_AUD_ADNWAY_CODE);
			}
			audStsCdList.push(CommonConstant.C_AUD_PASS_CODE);
			var audStsCdListArr = JSON.stringify(audStsCdList);
	        $.ajax({
	            url: '<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do?splId='+splId+'&&audStsCdList='+audStsCdListArr+'&&purpCd=2',
	            dataType:'json',
	            success: function (res) {
	                var splBackBankNoId = liger.get('splBackBankNoId');
	                splBackBankNoId.gridManager.loadData(res);
	                splBackBankNoId.clear();
	                if(backAccId){
	                	splBackBankNoId.setValue(backAccId);
	                }
	            }
	        });
   }
   var comboGrid_defaultValue3='${backAccId}';
   var comboGrid_defaultText3 = '${backAccNo}';
   var isInit_setSearchComboVal3 = false;
  var COMBO_BACK_BANK = $("#splBackBankNoId").ligerComboBox({
      width: 300,
      selectBoxWidth: 300,
      selectBoxHeight: 240,
      valueField: 'id',
      textField: 'accNo',
      isMultiSelect: true,
      isSingleCheck: true,
      grid: getBankNoGridOptions(true),
      delayLoadGrid: false
  });
  
  function getBankNoGridOptions(checkbox){
  	var splId =liger.get("splId").selectedValue;
      var options = {
          columns: [
              { display: 'id', name: 'id', minWidth: 150,hide:true },
              { display: '收款人', name: 'rcptUnt', 
          		render: function (rowdata, rowindex, value, column) { 
           		 value ==null?"":value;
           		var h = '';
           		if(rowdata.audStsCd){
           		  if(rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_NON||rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_IN){
	                    	h+='<i class="ico_flasher"></i>';
	                 }
           		}
                   h+=value;
                       return h;
           	},
            	  minWidth: 150 },
              { display: '对公/对私', name: 'bizTypCdNm', minWidth: 50 },
              { display: '收款账号', name: 'accNo', minWidth: 100 },
              { display: '开户银行', name: 'bkNm', minWidth: 150 },
              { display: '开户行号', name: 'bkNo', minWidth: 50 },
              
          ],
          switchPageSizeApplyComboBox: false,
          method: 'get',
          data:null,
          dataAction: 'local',
          root:'rows',
	        record:'total',
          pageSize: 10,
          usePagerOnLessPagesize: false,
          cssClass: "SMALL_grid",
         // checkbox: checkbox,
          isSingleCheck: true,
          frozen: false,
          isSelected: function (rowdata) {
              if (comboGrid_defaultValue3 == "") return false;
              var defaultItems = comboGrid_defaultValue3.split(";");
              if(!isInit_setSearchComboVal3) { //只在初始化时执行一次，在onAfterShowData后改变
                  for (var i = 0; i < defaultItems.length; i++) {
                      if(rowdata[COMBO_BACK_BANK.options.valueField] == defaultItems[i]) {
                          return true;
                      }
                  };
              };
              return false;
          },
          onAfterShowData: function (currentData) {
              if(!isInit_setSearchComboVal3) { //只在初始化时执行一次，在onAfterShowData后改变
              	COMBO_BANK.setInputValue(comboGrid_defaultValue3, comboGrid_defaultText3, true);
                  isInit_setSearchComboVal3 = true;
              }
          }
      };
      return options;
  }	
  
  
//销售返利账号
  function getSalBackBankNo(){
	    	var splId =liger.get("splId").selectedValue;
	    	if(splId==undefined){
	    		return;
	    	}
	    	var salBackAccId='${salBackAccId}';
	    	var audStsCdList = new Array();
			if(buOrgCd!=ProjectConstant.CODE_BU_ORG_CD_CAR){
			   audStsCdList.push(CommonConstant.C_AUD_ADNWAY_CODE);
			}
			audStsCdList.push(CommonConstant.C_AUD_PASS_CODE);
			var audStsCdListArr = JSON.stringify(audStsCdList);
	        $.ajax({
	            url: '<%=path%>/project/prjprdbscinfo/getSplBankAccNoBySplId.do?splId='+splId+'&&audStsCdList='+audStsCdListArr+'&&purpCd=11',
	            dataType:'json',
	            success: function (res) {
	                var salBackBankNoId = liger.get('salBackBankNoId');
	                salBackBankNoId.gridManager.loadData(res);
	                salBackBankNoId.clear();
	                if(salBackAccId){
	                	salBackBankNoId.setValue(salBackAccId);
	                }
	            }
	        });
  }
  
  var comboGrid_defaultValue5='${salBackAccId}';
  var comboGrid_defaultText5 = '${salBackAccNo}';
  var isInit_setSearchComboVal5 = false;
 var COMBO_SAL_BACK_BANK = $("#salBackBankNoId").ligerComboBox({
     width: 300,
     selectBoxWidth: 300,
     selectBoxHeight: 240,
     valueField: 'id',
     textField: 'accNo',
     isMultiSelect: true,
     isSingleCheck: true,
     grid: getSalBankNoGridOptions(true),
     delayLoadGrid: false
 });
 
 function getSalBankNoGridOptions(checkbox){
 	var splId =liger.get("splId").selectedValue;
     var options = {
         columns: [
             { display: 'id', name: 'id', minWidth: 150,hide:true },
             { display: '收款人', name: 'rcptUnt', 
         		render: function (rowdata, rowindex, value, column) { 
          		 value ==null?"":value;
          		var h = '';
          		if(rowdata.audStsCd){
          		  if(rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_NON||rowdata.audStsCd==FlowConstant.FLOW_CHECK_STATE_IN){
	                    	h+='<i class="ico_flasher"></i>';
	                 }
          		}
                  h+=value;
                      return h;
          	},
           	  minWidth: 150 },
             { display: '对公/对私', name: 'bizTypCdNm', minWidth: 50 },
             { display: '收款账号', name: 'accNo', minWidth: 100 },
             { display: '开户银行', name: 'bkNm', minWidth: 150 },
             { display: '开户行号', name: 'bkNo', minWidth: 50 },
             
         ],
         switchPageSizeApplyComboBox: false,
         method: 'get',
         data:null,
         dataAction: 'local',
         root:'rows',
	        record:'total',
         pageSize: 10,
         usePagerOnLessPagesize: false,
         cssClass: "SMALL_grid",
        // checkbox: checkbox,
         isSingleCheck: true,
         frozen: false,
         isSelected: function (rowdata) {
             if (comboGrid_defaultValue5 == "") return false;
             var defaultItems = comboGrid_defaultValue5.split(";");
             if(!isInit_setSearchComboVal5) { //只在初始化时执行一次，在onAfterShowData后改变
                 for (var i = 0; i < defaultItems.length; i++) {
                     if(rowdata[COMBO_SAL_BACK_BANK.options.valueField] == defaultItems[i]) {
                         return true;
                     }
                 };
             };
             return false;
         },
         onAfterShowData: function (currentData) {
             if(!isInit_setSearchComboVal5) { //只在初始化时执行一次，在onAfterShowData后改变
            	 COMBO_SAL_BACK_BANK.setInputValue(comboGrid_defaultValue5, comboGrid_defaultText5, true);
                 isInit_setSearchComboVal5 = true;
             }
         }
     };
     return options;
 }	
 
  
  //供应商厂商信息
   function getSplMfrInfo(){
	    	var splId =liger.get("splId").selectedValue;
	    	if(splId==undefined){
	    		return;
	    	}
	    	var splMfrId='${splMfrId}';
	        $.ajax({
	            url: '<%=path%>/project/prjprdbscinfo/getSplMfrBySplId.do?splId='+splId,
	            dataType:'json',
	            success: function (res) {
	                var prjPrdSplMfrId = liger.get('splMfrId');
	                prjPrdSplMfrId.gridManager.loadData(res);
	                prjPrdSplMfrId.clear();
	                if(splMfrId){
	                	prjPrdSplMfrId.setValue(splMfrId);
	                }
	            }
	        });
   }
   var comboGrid_defaultValue4='${splMfrId}';
   var comboGrid_defaultText4 = '${splMfrNm}';
   var isInit_setSearchComboVal4 = false;
  var COMBO_SPL_MFR = $("#splMfrId").ligerComboBox({
      width: 300,
      selectBoxWidth: 300,
      selectBoxHeight: 240,
      valueField: 'id',
      textField: 'mfrNm',
      isMultiSelect: true,
      isSingleCheck: true,
      grid: getSplMfrGridOptions(true),
      delayLoadGrid: false
  });
  
  function getSplMfrGridOptions(checkbox){
  	var splId =liger.get("splId").selectedValue;
      var options = {
          columns: [
              { display: 'id', name: 'id', minWidth: 150,hide:true },
              { display: '厂商名称', name: 'mfrNm', minWidth: 200 },
              
          ],
          switchPageSizeApplyComboBox: false,
          method: 'get',
          data:null,
          dataAction: 'local',
          root:'rows',
	        record:'total',
          pageSize: 10,
          usePagerOnLessPagesize: false,
          cssClass: "SMALL_grid",
         // checkbox: checkbox,
          isSingleCheck: true,
          frozen: false,
          isSelected: function (rowdata) {
              if (comboGrid_defaultValue4 == "") return false;
              var defaultItems = comboGrid_defaultValue4.split(";");
              if(!isInit_setSearchComboVal4) { //只在初始化时执行一次，在onAfterShowData后改变
                  for (var i = 0; i < defaultItems.length; i++) {
                      if(rowdata[COMBO_SPL_MFR.options.valueField] == defaultItems[i]) {
                          return true;
                      }
                  };
              };
              return false;
          },
          onAfterShowData: function (currentData) {
              if(!isInit_setSearchComboVal4) { //只在初始化时执行一次，在onAfterShowData后改变
            	  COMBO_SPL_MFR.setInputValue(comboGrid_defaultValue4, comboGrid_defaultText4, true);
                  isInit_setSearchComboVal4 = true;
              }
          }
      };
      return options;
  }	
  
  
  
  
  function setSplBackBankShow(){
  	var isBckNo = $("#isBckNo").val();
  	if(isBckNo=='1'){
  		 $("#splBckBankAccDiv").show();
  	}
  	if(isBckNo=='0'){
  		 $("#splBckBankAccDiv").hide();
  		 //设置值为空
  		  var splBackBankNoId = liger.get("splBackBankNoId").getValue();
          $("#splBackBankNoId").val("");
  	}
  }
  function setSalBackBankShow(){
	  	var isSalBckNo = $("#isSalBckNo").val();
	  	if(isSalBckNo=='1'){
	  		 $("#salBckBankAccDiv").show();
	  		 $("#msgDiv").show();
	  		
	  	}
	  	if(isSalBckNo=='0'){
	  		 $("#salBckBankAccDiv").hide();
	  		 $("#msgDiv").hide();
	  		 //设置值为空
	  		  var splBackBankNoId = liger.get("salBackBankNoId").getValue();
	          $("#salBackBankNoId").val("");
	  	}
	  }	
  
function getSplAccNos(){
	getSplBankNo();
	getSplBackBankNo();
	getSplMfrInfo();
	getSalBackBankNo();
}
// 初始化厂商下拉
function initMfrComboBox(){
    $("#mfr").ligerComboBox(
        {
            url: '<%=path%>/product/mfrInfo/searchList.do',
            valueField: 'id',
            textField: 'mfrNm',
            selectBoxWidth: 200,
            autocomplete: function (e){
                filter_autoComboboxData(e.key, this);
                e.show();
            },keySupport:true,onChangeValue:function(value){
                var mfrId = liger.get("mfr").getValue();
                $("#mfrId").val(mfrId);
                $("#mfrNm").val(value);
            },
            width: 200
        }
    );
}
  
</script>
<div class="ClearLine"></div>
</body>
</html>
